import request from "@/utils/request";

/* 获取所有企业 */
export function getCompanyManagerList () {
  return request({
    url: "/company/manager/getCompanyManagerList",
    method: "post",
    data: { type: 1 }
  });
}

/**
 * 查询知识产权总表
 * limit 页面条数
 * page 页码
 **/
export function queryCompanyCopyrightList (query) {
  return request({
    url: "/copyright/queryCompanyCopyrightList",
    method: "get",
    params: query
  });
}

// 查询专利类别列表
export function getCompanyCopyrightTypeList (query) {
  return request({
    url: "/copyright/getCompanyCopyrightTypeList",
    method: "get",
  });
}

// 查询总表类别及总和
export function getTypeListAndCountByCompanyId (id) {
  return request({
    url: "/copyright/getTypeListAndCountByCompanyId",
    method: "get",
    params: {
      companyId: id
    }
  });
}

// 查询高企规划信息表
export function getCompanyPlanByCompanyId (id) {
  return request({
    url: "/plan/getCompanyPlanByCompanyId",
    method: "get",
    params: {
      id: id
    }
  });
}

// 查询高企规划信息表技术领域
export function getTechnicalFieldList (query) {
  return request({
    url: "/plan/getTechnicalFieldList",
    method: "get",
  });
}

// 查询企业知识产权子表详细
export function getCompanyCopyrightById (configId) {
  return request({
    url: "/copyright/getCompanyCopyrightById",
    method: "get",
    params: {
      id: configId
    }
  });
}

// 查询信息通知
export function getCompanyInfoNotice (configId) {
  return request({
    url: "/thinkerdata/companyInfoNotice/selectById/" + configId,
    method: "post"
  });
}

// 查询日志
export function getCompanyInfoLog (configId) {
  return request({
    url: "/thinkerdata/companyInfoLog/getCompanyInfoLog/" + configId,
    method: "get"
  });
}

// 新增企业知识产权
export function addCompanyCopyright (data) {
  return request({
    url: "/copyright/addCompanyCopyright",
    method: "post",
    data: data
  });
}

// 新增高企规划信息
export function addCompanyPlan (data) {
  return request({
    url: "/plan/addCompanyPlan",
    method: "post",
    data: data
  });
}

// 新增企业信息通知详情
export function addSystemMessage (data) {
  return request({
    url: "/system/message/addSystemMessage",
    method: "post",
    data: data
  });
}

// 修改企业知识产权
export function updateCompanyCopyright (data) {
  return request({
    url: "/copyright/updateCompanyCopyright",
    method: "post",
    data: data
  });
}

// 修改高企规划信息
export function updateCompanyPlan (data) {
  return request({
    url: "/plan/updateCompanyPlan",
    method: "post",
    data: data
  });
}

// 修改企业信息通知详情
export function updateCompanyInfoNotice (data) {
  return request({
    url: "/thinkerdata/companyInfoNotice/updateCompanyInfoNotice",
    method: "put",
    data: data
  });
}

// 删除配置
export function deleteCompanyInfo (ids) {
  return request({
    url: "/copyright/delCompanyCopyrightByIds",
    method: "get",
    params: {
      ids
    }
  });
}

// 导出
export function exportConfig (query) {
  return request({
    url: "/thinkerdata/companyInfo/export",
    method: "get",
    params: query
  });
}
